#ifndef DEAL_NETWORK_STATUS_H
#define DEAL_NETWORK_STATUS_H


#include<QObject>
#include<QTimer>
class DealNetworkStatus : public QObject
{
    Q_OBJECT
public:
    DealNetworkStatus();
public slots:
    //开始网络监听
    void stopMonitorNetwork();
    //关闭网络监听
    void startMonitorNetwork();
public:
    /**
     * @brief 测试网络状况
     */
    bool testNetworkStatus();
private:
    QTimer *m_timer;
    /**
     * @brief 服务器状态
     */
    enum NetworkStatus{
        Normal = 0,
        Disconnect = 1,
        Maintain = 2
    };

signals:
    /**
     * @brief 把处理后的结果返回给主线程
     */
    void sendNetworkStatus(int);
};

#endif // DEAL_NETWORK_STATUS_H
